<template>
	<view class="content">
		<view class="table-title">
			意见反馈
		</view>
		<view class="content-panel">
			<uni-forms ref="form" :modelValue="formData" :rules="rules" label-width="0rpx;">
				<uni-forms-item name="remark" >
					<uni-easyinput placeholder="请输入意见反馈" v-model="formData.remark" type="textarea"/>
				</uni-forms-item>
				<uni-forms-item label-width="0rpx;">
					<button @click="submit">提 交</button>
				</uni-forms-item>
			</uni-forms>
		</view>
	</view>
</template>

<script>
	import {mapMutations} from 'vuex'
	export default {
		data() {
			return {
				formData:{
					remark: undefined,
				},
				rules:{
					remark: {
						rules: [
							{required: true,errorMessage: "不能为空"}
						]
					},
				},
			}
		},
		methods: {
			// ...mapMutations(['clearInfo']),
			submit() {
				uni.showLoading()
				this.$refs.form.validate().then(res => {
					this.$http({
						url: '/userConfig/feedback/feedback',
						method: 'post',
						data: this.formData
					}).then(res => {
						// let msg = '反馈成功'
						// uni.showToast({
						// 	title: msg
						// })
						uni.reLaunch({
							url:'/pages/user/user/user'
						})
					})
					
				}).catch(err => {
					uni.hideLoading()
				})
			},
		}
	}
</script>

<style lang="scss">
	.table-title{
		height: 140rpx;
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		font-weight: bolder;
		padding-left: 5%;
		padding-right: 5%;
		line-height: 70rpx;
		border: solid 1rpx #e8f4ff;
		background-color: #e8f4ff;
		color: #1890ff;
		letter-spacing: 2rpx;
		text-align: center;
	}
	.content-panel {
		height: 300rpx;
		width: 600rpx;
		margin-top: 50rpx;
	}
	button {
		height: 80rpx;
		line-height: 80rpx;
		background-color: #1296db;
		color: white;
	}
</style>